<?php

/**
 * CelebrioMail default
 *
 * @copyright  Copyright (c) 2011 Celebrio Software
 * @package    CelebrioMail
 */

namespace ApplicationsModule\TalkerModule;

use WebtopModule\BasePresenter;
use Nette\Forms\Form;

class SkypePresenter extends BasePresenter {

    /**
     * @var type ImoCommunicator
     */
    private $imo;

    public function setImo($imo) {
        $this->imo = $imo;
    }

    /**
     *
     * @return type ImoCommunicator
     */
    public function getImo() {
        return $this->imo;
    }

    public function startup() {
        parent::startup();
        //header("Content-type:text/html; charset=utf-8"); // TODO: poresit
        $this->setImo(new ImoCommunicator());
    }

    public function renderDefault() {
    }

    public function actionAjax($data, $method = "forward_to_server") {
        $this->payload->message = $this->getImo()->message($method, $data);
    }
}